<#setting classic_compatible=true> <#assign
	base=request.contextPath /> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="${base}/zhgl-jzstyxx-manage/css/messagePandect/messagePandect.css">
<link rel="stylesheet" type="text/css" href="${base}/zhgl-jzstyxx-manage/css/overview/overView.css">
<link rel="stylesheet" type="text/css" href="${base}/zhgl-jzstyxx-manage/css/system/changeStyle.css">
<title>统一消息中心</title>
<!-- 引入通用css -->
<#include "/common/commoncss.ftl">
</head>

<body>
	<!-- 标题栏区域 -->
	<div class="titleColumn">
		<!-- <span class="iconfont icon-peizhi"></span><span id="messagePan" style="margin-left: 20px;">消息总览</span> -->
		<span class="iconfont icon-peizhi"></span><span style="margin-left:20px;">系统管理</span>&nbsp;&nbsp;<span class="fa fa-angle-right"></span>&nbsp;&nbsp;<span id="messagePan">风格切换</span>
	</div>
	<!-- 正文区域 -->
	<div class="contentTable">
		<div class="now"><a id="a1" onclick="changeStylea1()"><img class="pic" src="${base}/zhgl-jzstyxx-manage/images/a1.jpg"/></a></div>
		<div class="now"><a id="a2" onclick="changeStylea2()"><img class="pic" src="${base}/zhgl-jzstyxx-manage/images/a2.jpg"/></a></div>
		<div class="now">
			姓名：<input type="text" name="username" id="username">
			<br/>
			密码：<input type="text" name="password" id="password">
			<br/>
			电话：<input type="text" name="tel" id="tel">
			<br/>
			<input type="button" onclick="addUser()" value="redis提交"/>
			<input type="button" onclick="addUser1()" value="mongoDB提交"/>
			<br/>
		</div>
		<div class="now">
			<input type="text" name="id" id="id">
    		<input type="reset"  onclick="lookUser()" value="redis查找id"/>
    		<input type="text" name="name" id="name">
    		<input type="reset"  onclick="lookUser1()" value="mongoDB查找name"/>
		</div>
		<div class="now">
			 <form id="fileform"  enctype="multipart/form-data" method="post" action="${request.contextPath}/zhgl-jzstyxx-manage/index/upexcel">
		           <input type="file" name="file" id="file_input">
		           <input type="submit" value="导入数据" class="file" onclick="">
		     </form> 
			<button onclick="xzexcel()">下载oracle中用户形成表格</button>
		</div>
		<div class="now">
			显示身份证号：<br/>
			<input type="text" id="sfz"/><button onclick="sfz()">身份证正面识别</button><br/>
			显示有效期：<br/>
			<input type="text" id="sfzf"/><button onclick="sfzf()">身份证反面识别</button>
		</div>
		<div class="now">
			演示SHA-2单向散列函数:<br/>
			<input type="text" id="name1" placeholder="输入六位数字"/><button onclick="sha()">计算单向散列函数</button>
			<button onclick="qingcu()" id="qingcu">清除</button>
			<span id="md5xianshi"></span>
		</div>
		<div class="now">
			显示营业执照:<br/>
			<input type="text" id="name2" /><button onclick="xydm()">信用代码</button>
		</div>
		<div class="now">
			上传图片：<br/>
			<input type="file" id="picture"><button onclick="upLoad()">上传图片</button>
		</div>
	</div>
	

	<!-- 引入通用和js -->
	<#include "/common/commonjs.ftl"> 
	<script type="text/javascript" src="${base}/zhgl-jzstyxx-manage/js/login/jquery.cookie.js"></script>
	<script type="text/javascript" src="${base}/zhgl-jzstyxx-manage/js/login/jquery.session.js"></script>
	<script type="text/javascript">
	//
	function changeStylea1(){
		top.window.location.reload();
	}
	//
	function changeStylea2(){
		top.$(".nav_menu").css('background','#EDEDED');
		top.$(".toggle h4").css('color','#fff');
		top.$(".toggle a").css('color','#5A738E');
		top.$(".col-md-3 .left_col").css('background','#2A3F54');
		top.$(".nav_title").css('background','#2A3F54');
	}
	
	function addUser(){
		var password=$("#password").val();
		var username=$("#username").val();
		var tel=$("#tel").val();
		$.ajax({
			"type":"POST",
			"url":"../index/addredis",
			"dataType":"json",
			"data":{"username":username,"password":password,"tel":tel},
			"success":function(obj){
				if(obj!=null){
					console.log("redis:"+obj);
				}
			}
		});
	}
	
	function addUser1(){
		var password=$("#password").val();
		var username=$("#username").val();
		var tel=$("#tel").val();
		$.ajax({
			"type":"POST",
			"url":"../index/addmongoDB",
			"dataType":"json",
			"data":{"username":username,"password":password,"tel":tel},
			"success":function(obj){
				if(obj!=null){
					console.log("mongoDB:"+obj);
				}
			}
		});
	}
	
	function lookUser(){
		var id=$("#id").val();
		$.ajax({
			"type":"POST",
			"url":"../index/lookredis",
			"dataType":"json",
			"data":{"id":id},
			"success":function(obj){
				if(obj!=null){
					console.log("redis用户:"+obj);
				}
			}
		});
	}
	
	function lookUser1(){
		var name=$("#name").val();
		$.ajax({
			"type":"POST",
			"url":"../index/lookmongoDB",
			"dataType":"json",
			"data":{"name":name},
			"success":function(obj){
				if(obj!=null){
					console.log("mongo用户:"+obj);
					console.log(obj);
				}
			}
		});
	}
	
	//身份证正面
	function sfz(){
		var name="panyi";
		$.ajax({
			"type":"POST",
			"url":"../index/sfz",
			"dataType":"json",
			"data":{"name":name},
			"success":function(obj){
				if(obj!=null){
					//console.log(obj);
					//console.log(obj.words_result.公民身份号码.words);
					$("#sfz").val(obj.words_result.公民身份号码.words);
				}
			}
		});
	}
	
	//身份证反面
	function sfzf(){
		var name="panyi";
		$.ajax({
			"type":"POST",
			"url":"../index/sfzf",
			"dataType":"json",
			"data":{"name":name},
			"success":function(obj){
				if(obj!=null){
					//console.log(obj);
					//console.log(obj.words_result.失效日期.words);
					$("#sfzf").val(obj.words_result.失效日期.words);
				}
			}
		});
	}
	
	function sha(){
		var name=$("#name1").val();
		$.ajax({
			"type":"POST",
			"url":"../index/sha",
			//"dataType":"json",
			"data":{"name":name},
			"success":function(obj){
				if(obj!=null){
					//console.log(obj);
					$("#md5xianshi").html(obj);
					//console.log(obj[1].length);
				}
			}
		});
	}
	
	function qingcu(){
		$("#md5xianshi").html("");
	}
	
	//信用代码
	function xydm(){
		var name="panyi";
		$.ajax({
			"type":"POST",
			"url":"../index/xydm",
			"dataType":"json",
			"data":{"name":name},
			"success":function(obj){
				if(obj!=null){
					//console.log(obj);
					//console.log(obj.words_result.社会信用代码.words);
					$("#name2").val(obj.words_result.社会信用代码.words);
				}
			}
		});
	}
	
	//下载excel
	function xzexcel(){
		var name="panyi";
		$.ajax({
			"type":"POST",
			"url":"../index/xzexcel",
			"dataType":"json",
			"data":{"name":name},
			"success":function(obj){
				if(obj!=null){
					console.log(obj);
					
				}
			}
		});
	}
	
	//上传图片
	function upLoad(){
		var name="panyi";
		$.ajax({
			"type":"POST",
			"url":"../index/upload1",
			"dataType":"json",
			"data":{"name":name},
			"success":function(obj){
				if(obj!=null){
					console.log(obj);
					
				}
			}
		});
	}
	</script>


</body>
</html>